<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 *订单管理
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$return=array();
//$this->model('task')->test();
$return['types']=array(
	'7'=>'未满释放茶果',
	'8'=>'茶果兑换'.$this->cd_title.'',
);
$tabs=array(
	array('op'=>'list','title'=>'全部记录'),
); 
if($_RQ['op']=='list'){
	$return['params']=array();
	$params=array('uniacid'=>$_SESSION['uniacid'],'type'=>array(7,8));
	if(isset($_RQ['type'])){
		$params['type']=intval($_RQ['type']);
		$return['params']['type']=intval($_RQ['type']);
	}
	if($_RQ['mid']){
		$params['mid']=$_RQ['mid'];
		$return['params']['mid']=$_RQ['mid'];
	}
	if($_RQ['canlogid']){
		$params['canlogid']=intval($_RQ['canlogid']);
		$return['params']['canlogid']=intval($_RQ['canlogid']);
	}
	$pindex = max(1, intval($_RQ['page']));
	if($_RQ['psize']){
		$_SESSION['psize']=$_RQ['psize'];
	}
	$psize = $_SESSION['psize']?:10;
	$list=pdo_getslice('jy_nongfee_feelog',$params,array($pindex,$psize),$total,$fields,'','id desc');
	if($list){
		foreach($list as $k=>&$v){
			$v['member']=cfc('core')->member_show($v['mid']);
			$teampaixu=pdo_getcolumn('jy_nongfee_cang',array('id'=>$v['cangid'],'uniacid'=>$_SESSION['uniacid']),'title');
			$yaopaixu=pdo_getcolumn('jy_nongfee_yao',array('id'=>$v['yaoid'],'uniacid'=>$_SESSION['uniacid']),'paixu');
			$v['title']=$teampaixu.'第'.$yaopaixu.''.$this->y_title;
		}
	}
	$return['list']=$list;
	$totalpage=ceil($total/$psize);
	$totalpage=intval($totalpage);
	$return['totalpage'] =$totalpage;
	$return['params']['page'] =$pindex;
	$htmls=array(
		'type'=>'list',
		'tabs'=>$tabs,
		'list'=>array('data'=>'list','tip'=>'[温馨提示]：</br>这里显示所有的记录信息！','edit'=>false,'del_one'=>false,'delall'=>false,
		'total'=>$total,
		'psize'=>$psize,
		'list'=>array(
			array('name'=>'mid','title'=>'会员Mid','type'=>'string'),
			array('name'=>'canlogid','title'=>'参与记录ID','type'=>'string'),
			array('name'=>'member','title'=>'会员信息_Member','type'=>'member'),
			array('name'=>'type','title'=>'类型','type'=>'radio','options'=>'types'),
			array('name'=>'title','title'=>'庄园','type'=>'string'),
			array('name'=>'fee','title'=>'额度','type'=>'string'),
			array('name'=>'createtime','title'=>'创建时间','type'=>'time'),
		)),
		'search'=>array(
			array('name'=>'type','width'=>15,'title'=>'类型','type'=>'radio','options'=>'types'),
			array('type'=>'string','width'=>15,'name'=>'canlogid','title'=>'参与记录ID'),
			array('type'=>'choose','width'=>15,'action'=>'core/member.get_member/','name'=>'mid','title'=>'选择会员'),

		)
	);
	$return['htmls']=$htmls;	
	exi($return);
}